﻿<%@ page language="java" import="java.util.*,com.shop.mall.entity.*,com.shop.mall.dao.impl.*"
         pageEncoding="utf-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <title>update Page</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        #box1 {
            margin: 0 auto;
            width: 600px;
            height: 230px;
            border: 1px solid blanchedalmond;
        }

        #showGoods {
            width: 250px;
            height: 210px;
            float: left;
        }

        #showGoods ul li {
            text-align: center;
            border: 1px solid blanchedalmond;
            width: 250px;
            list-style: none;
            line-height: 30px;
        }

        #showGoods2 {
            width: 350px;
            height: 210px;
            float: left;
        }

        #showGoods2 ul li {
            border: 1px solid blanchedalmond;
            width: 350px;
            list-style: none;
            line-height: 30px;
        }

        .title {
            font-size: 18px;
            font-weight: bold;
            line-height: 30px;
        }
    </style>
</head>
<% request.setCharacterEncoding("utf-8");
    String id = request.getParameter("id");
    BookDaoImpl bd = new BookDaoImpl();
    List<Book> list = bd.select(Integer.parseInt(id));
%>

<body>
<%
    for (Book book : list) {
%>
<form action="${pageContext.request.contextPath}/BookServlet?operation=updateBook&id=<%=book.getId() %>" method="post">
    <div id="box1">
        <div id="showGoods">
            <ul class="title">
                <li>书名</li>
                <li>编号</li>
                <li>出版社</li>
                <li>价格</li>
                <li>出版日期</li>
            </ul>
        </div>
        <div id="showGoods2">
            <ul class="title">
                <li><input type="text" value="<%=book.getBookname() %>" name="bookname"></li>
                <li><input type="text" value="<%=book.getIsbn()%>" name="isbn"></li>
                <li><input type="text" value="<%=book.getPublisher() %>" name="publisher"></li>
                <li><input type="text" value="<%=book.getPrice() %>" name="price"></li>
                <li><input type="text" value="<%=book.getPublisdate() %>" name="publisdate"></li>
            </ul>
            <ul class="title">
                <input type="submit" value="修改" class=""/>
                &nbsp;&nbsp;
                <button><a href="/pages/book/index.jsp">取消</a></button>
            </ul>
            <%
                }
            %>
        </div>
    </div>
</form>
</body>
</html>
